import Vue from 'vue';
import Vuex from 'vuex';

import mutations from "./mutations";
import actions from "./actions";
import getters from "./getters";
import moduleA from "./modules/moduleA";

// 安装插件
Vue.use(Vuex);

const state = {
  counter: 1000,
  students: [
    {id: 110, name: 'xmo', age:20},
    {id: 111, name: 'zhaoyi', age:20},
    {id: 112, name: 'xumo', age:17},
    {id: 113, name: 'duming', age:19},      
  ],
  info: {
    name: 'yangchen',
    age: 30,
    height: 1.78
  }
};

// 创建对象
const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters,
  modules: {
    a: moduleA
  }
});

export default store;